import { Empty, FormInstance } from 'antd'
export const searchConfig = ({
  SupplierOption,
  handleSearchSupplier,
  ProDevSeason,
  SpuOptions,
  handleSearchSpuOptions,
}: {
  SupplierOption: IOptionItem[]
  ProDevSeason: IOptionItem[]
  SpuOptions: IOptionItem[]
  handleSearchSupplier: (newVal: string) => void
  handleSearchSpuOptions: (newVal: string) => void
  form: FormInstance
}): IItemArray[] => {
  return [
    {
      label: '预计提货时间',
      name: 'dispatchTimeStart',
      type: 'FixedRangePicker',
      config: { showTime: true, customFormat: 'YYYY-MM-DD HH:mm:ss' },
    },
    {
      label: '预计送货时间',
      name: 'deliveryTimeStart',
      type: 'FixedRangePicker',
      config: { showTime: true, customFormat: 'YYYY-MM-DD HH:mm:ss' },
    },
    {
      label: '物流需求单状态',
      name: 'transportStatusList',
      type: 'Select',
      option: [
        { label: '待预约', value: 0 },
        { label: '已预约', value: 1 },
        { label: '已取消', value: 2 },
      ],
      placeholder: '请选择物流需求单状态',
      config: {
        mode: 'multiple',
        maxTagCount: 'responsive',
        showSearch: true,
        optionFilterProp: 'label',
      },
    },
    {
      label: '物流需求单号',
      name: 'transportationOrderCode',
      type: 'Input',
      placeholder: '请输入物流需求单号',
    },
    {
      label: '运单号',
      name: 'wayBillNoList',
      placeholder: '多个编码间需要换行或使用","分隔',
      type: 'Select',
      config: {
        mode: 'tags',
        maxTagCount: 'responsive',
        tokenSeparators: [',', '，', '\n', '\r', '\r\n'],
        notFoundContent: null,
      },
    },
    {
      label: '预约发货单号',
      name: 'reserveInvoiceCodeList',
      placeholder: '多个编码间需要换行或使用","分隔',
      type: 'Select',
      config: {
        mode: 'tags',
        maxTagCount: 'responsive',
        tokenSeparators: [',', '，', '\n', '\r', '\r\n'],
        notFoundContent: null,
      },
    },
    {
      label: '采购单号',
      name: 'purchaseOrderCodeList',
      placeholder: '多个编码间需要换行或使用","分隔',
      type: 'Select',
      config: {
        mode: 'tags',
        maxTagCount: 'responsive',
        tokenSeparators: [',', '，', '\n', '\r', '\r\n'],
        notFoundContent: null,
      },
    },
    {
      name: 'querySupplierIdList',
      label: '物流需求方',
      type: 'Select',
      option: SupplierOption,
      config: {
        mode: 'multiple',
        maxTagCount: 'responsive',
        suffixIcon: null,
        showSearch: true,
        optionFilterProp: 'label',
        filterOption: false,
        onSearch: handleSearchSupplier,
        notFoundContent: <Empty description="请输入内容搜索" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
      },
    },
    {
      label: '创建时间',
      name: 'createTimeStart',
      type: 'FixedRangePicker',
      config: { showTime: true, customFormat: 'YYYY-MM-DD HH:mm:ss' },
    },
    {
      label: 'SPU商品',
      name: 'spuCode',
      type: 'Select',
      placeholder: '款式编码/款式名称/助记码',
      option: SpuOptions,
      config: {
        suffixIcon: null,
        showSearch: true,
        filterOption: false,
        optionFilterProp: 'label',
        onSearch: handleSearchSpuOptions,
        notFoundContent: <Empty description="请输入内容搜索" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
      },
    },
  ]
}
